/*
 *   Copyright (c) 2010 Sonrisa Informatikai Kft. All Rights Reserved.
 * 
 *  This software is the confidential and proprietary information of
 *  Sonrisa Informatikai Kft. ("Confidential Information").
 *  You shall not disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Sonrisa.
 * 
 *  SONRISA MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
 *  THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
 *  TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 *  PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SONRISA SHALL NOT BE LIABLE FOR
 *  ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
 *  DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 */

package com.zh.jbet.web.components.datatable;

import com.zh.jbet.web.JBetServiceProvider;
import java.io.Serializable;

/**
 *
 * @author sonrisa
 */
public class TableColumnDescriptor implements Serializable {
    public enum ColumnType {
        PROPERTY,
        DATE_PROPERTY,
        FILTERED
    }
    private ColumnType type;
    private String property;
    private Class<?> enumChoice;
    private JBetServiceProvider serviceProvider;
    private boolean sortable;

    public TableColumnDescriptor(ColumnType type, String property, boolean sortable) {
        this.type = type;
        this.property = property;
        this.sortable = sortable;
    }

    public TableColumnDescriptor(String property, JBetServiceProvider serviceProvider, boolean sortable) {
        this.type = ColumnType.FILTERED;
        this.property = property;
        this.serviceProvider = serviceProvider;
        this.sortable = sortable;
    }

    public TableColumnDescriptor(String property, Class<?> enumChoice, boolean sortable) {
        this.type = ColumnType.FILTERED;
        this.property = property;
        this.enumChoice = enumChoice;
        this.sortable = sortable;
    }

    public TableColumnDescriptor(ColumnType type, String property, Class<?> enumChoice, boolean sortable) {
        this.type = type;
        this.property = property;
        this.enumChoice = enumChoice;
        this.sortable = sortable;
    }

    public Class<?> getEnumChoice() {
        return enumChoice;
    }

    public String getProperty() {
        return property;
    }

    public ColumnType getType() {
        return type;
    }

    public boolean isSortable() {
        return sortable;
    }

    public JBetServiceProvider getServiceProvider() {
        return serviceProvider;
    }
    
}
